package guowenlong.golf.ui.personal.info;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import guowenlong.golf.R;
import guowenlong.golf.widget.IOSEditText;

/**
 * des   : 描述
 * author: Administrator
 * email : guowenlong20000@gmail.com
 * time  : 2017年03月25日 上午 12:26.
 */

public class InputTextActivity extends AppCompatActivity {

  @BindView(R.id.ib_back)
  TextView ibBack;
  @BindView(R.id.tv_title)
  TextView tvTitle;
  @BindView(R.id.btn_save)
  Button btnSave;
  @BindView(R.id.et_inputtext)
  IOSEditText etInputtext;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    restoreActionBar();
    setContentView(R.layout.activity_inputtext);
    ButterKnife.bind(this);
  }

  public void restoreActionBar() {
    ActionBar actionBar = getSupportActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.hide();
    actionBar.setDisplayShowTitleEnabled(false);
  }

  @OnClick({R.id.ib_back, R.id.btn_save})
  public void onClick(View view) {
    switch (view.getId()) {
      case R.id.ib_back:
        setResult(RESULT_CANCELED);
        finish();
        break;
      case R.id.btn_save:
        Intent intent = new Intent(this, PersonalInfomationActivity.class);
        intent.putExtra("name",etInputtext.getText().toString());
        setResult(RESULT_OK,intent);
        finish();
        break;
    }
  }
}
